{template 'common/header'}

<script type="text/javascript " src="../addons/lxy_buildpro/template/js/jquery.json-2.4.min.js"></script>

<style>
.photo_list{padding:15px 0;}
.photo_list .alert{width:auto; margin-top:10px; overflow:hidden;}
.photo_list .photo_preview{width:130px;}
.photo_list .photo_preview img{width:130px; margin-bottom:5px;}
.photo_list .photo_preview label{padding:0;}
.photo_list .photo_preview input[type="radio"]{margin-left:0; margin-right:10px;}
.photo_list table{margin-left:40px;}
.photo_list table th,.photo_list table td{padding-bottom:5px;}
.photo_list table th{width:60px; font-size:14px;}
.photo_list table input,.photo_list table select{margin-bottom:0;}
</style>

<div class="main">
<ul class="nav nav-tabs">
	<li{if $_GPC['do'] == 'buildlists'} class="active"{/if}><a href="{php echo $this->createWeburl('buildlists');}">楼盘管理</a></li>
	<li{if $_GPC['do'] == 'houselist'} class="active"{/if}><a href="{php echo $this->createWeburl('houselist', array('hid'=>$hid));}">户型管理</a></li>
	<li{if $_GPC['do'] == 'houseadd'} class="active"{/if}><a href="{php echo $this->createWeburl('houseadd', array('hsid'=>$hsid,'hid'=>$hid));}">添加户型</a></li>
</ul>
<form action="" class="form-horizontal form" method="post" enctype="multipart/form-data" name="hxform" id="hxform"> 
	<input type="hidden" name="id" value="{$item['id']}">
    <input type="hidden" name="hid" value="{$hid}">
  <div class="panel panel-info">
<div class="panel-heading">户型基本信息</div>
<div class="panel-body">
<input type="hidden" name="id" value="{$item['id']}">
<div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">户型名称</label>
  <div class="col-sm-9">
    <input type="text" id="title" name="title" value="{$item['title']}"  class="form-control" />
    <span class="help-block">* 尽量简单，不要超过20字</span>
  </div>
</div>
<div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">选择子楼盘</label>
  <div class="col-sm-9">
    <select name="sid" id="sid" class="form-control">
            {loop $buildsublist $sl}
            <option value="{$sl['sid']}" {if $sl['sid']==$item['sid']}selected="selected"{/if}>{$sl['title']}</option>
            {/loop}
	        </select>
    <span class="help-block">* 尽量简单，不要超过20字</span>
  </div>
</div>
<div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">楼层</label>
  <div class="col-sm-9">
    <input type="text" id="louceng" name="louceng" value="{$item['louceng']}"  class="form-control" />
    <span class="help-block">* 如：3-10</span>
  </div>
</div>
  <div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">建筑面积</label>
  <div class="col-sm-9">
    <input type="text" id="mianji" name="mianji" value="{$item['mianji']}"  class="form-control" />
    <span class="help-block">* 如：约103平方米</span>
  </div>
</div>
    <div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">房屋户型</label>
  <div class="col-xs-12 col-sm-3 col-md-2">
    <select name="fang" id="fang"  class="col-md-2 form-control">
			  <option value="1" {if $item['fang']==1}selected="selected"{/if}>1</option>
			  <option value="2" {if $item['fang']==2}selected="selected"{/if}>2</option>
			  <option value="3" {if $item['fang']==3}selected="selected"{/if}>3</option>
			  <option value="4" {if $item['fang']==4}selected="selected"{/if}>4</option>
			  <option value="5" {if $item['fang']==5}selected="selected"{/if}>5</option>
		    </select>
			 <span>房</span>
			  <select name="ting" id="ting" class="col-md-2 form-control">
              <option value="1" {if $item['ting']==1}selected="selected"{/if}>1</option>
			  <option value="2" {if $item['ting']==2}selected="selected"{/if}>2</option>
			  <option value="3" {if $item['ting']==3}selected="selected"{/if}>3</option>
			  <option value="4" {if $item['ting']==4}selected="selected"{/if}>4</option>
			  <option value="5" {if $item['ting']==5}selected="selected"{/if}>5</option>
	        </select>
		    <span>厅</span>
  </div>
</div>
  <div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">显示顺序</label>
  <div class="col-sm-9">
    <input type="text" id="sort" name="sort" value="{$item['sort']}"  class="form-control" />
    <span class="help-block">* 数值越大越靠前</span>
  </div>
</div>
<div class="form-group">
  <style>
.item_input textarea {
width: 150px;
height: 20px;
margin-top: 0;
margin-top: 0\0;
_margin-top: -1px;
border: #d3d3d3 1px solid;
border-top: none;
display: block;
font: 12px/20px Arial, "SimSun";
overflow: hidden;
padding: 0 2px;
}
</style>

  <label class="col-xs-12 col-sm-3 col-md-2 control-label">户型介绍</label>
  <div class="col-sm-9">
    <textarea style="height:100px;" class="span7 richtext-clone" name="jianjie" cols="70" id="jianjie">{$item['jianjie']}</textarea> 
  </div>
</div>
	<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">户型图片</label>
                    <input id="hxpiclist"  name="hxpiclist" type="hidden"  value="{$jsonpic}" />

					<div class="col-xs-12 col-sm-9">
{php echo $this->tpl_multi_image_withsize('pic',$arrPic)}
						<div class="help-block">建议尺寸：宽720像素，高350像素</div>
					</div>
				</div>
		<div class="form-group col-sm-12">
			<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
			<input type="hidden" name="token" value="{$_W['token']}" />
		</div>
</form>
<script>
		$(function(){		
			$('#hxform').submit(function(){
				var pics = [];
				$('#fileList').find('div').each(function(){
					var msg = {};
					var img = $(this).find('img');
					msg.src = img.attr('src');
					msg.txt = $.trim($(this).find('textarea').val());
					var w = img.width();
					var h = img.height();
					w = parseInt(450*w/h);
					msg.w = w;
					msg.h = 450;
					pics[pics.length] = msg;
				});
				$('#hxpiclist').val($.toJSON(pics));
			});
		});
	</script> 

{template 'common/footer'}